package com.realtyManage.springboot.Config;

import com.realtyManage.springboot.Interceptor.AuthorizationInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * InterceptorConfig
 *
 * @Author 杭州素色网络科技有限公司
 * @Date 2019/7/28
 **/

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Autowired
    private AuthorizationInterceptor authorizationInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(authorizationInterceptor)
                .addPathPatterns("/user/**")//"/management/**",
                .excludePathPatterns("/index");
    }
}
